//
//  CCDelete.h
//  CCFC_IPHONE
//
//  Created by  xuchen(陈旭)， xichen(陈曦)， qq：511272827 on 10-10-31.
//  Copyright 2010 cc_team. All rights reserved.
//
#ifndef	CC_DELETE
#define	CC_DELETE

#include "CCAll.h" 

#ifdef	OBJC_MACRO
#define	RELEASE(obj)	[obj release]
#define	DELETE(obj)		\
		{		\
			NSUInteger retainCount = [(obj) retainCount];		\
			for(int i = 0; i < retainCount && retainCount != UINT_MAX; i++)	\
			{			\
				[(obj) release];	\
			}		\
		}

#define	SAFE_DELETE(obj)	\
		{		\
			DELETE(obj);		\
			(obj) = nil;		\
		}
		

#endif	//OBJC_MACRO

#endif	//CC_DELETE

